package com.coc.ofhibernate.controller;

import com.alibaba.druid.stat.DruidDataSourceStatManager;
import com.alibaba.druid.stat.DruidStatManagerFacade;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.management.JMException;

@RestController
public class DruidStatController {

    @GetMapping("/druid/stat")
    public Object druidStat(){
        return DruidStatManagerFacade.getInstance().getDataSourceStatDataList();
    }

    @GetMapping("/druid/stat2")
    public Object druidStat2 () throws JMException {
        return DruidDataSourceStatManager.getInstance().getDataSourceList();
    }

}
